Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for running go-transcode on Windows #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hheimbuerger
Copy link

I know this probably isn't very high on your list, but I have a use case for on-demand transcoding on Windows, couldn't find any other existing project doing this as easily as this one, and it works with some minor changes, so… here we go!

Let me know what you think and how you want to proceed with this. I see this primarily as a test balloon, to figure out whether changes like this are something you're interested in merging upstream?
I could understand if this isn't something you want to deal with (and I'm probably not interested in maintaining this long-term either). I guess I'd just use my fork for my upcoming project and not open further pull requests related to Windows-support.


Some technical notes:

Really the only platform-dependent bits of code were the process group management. I've replaced those with Windows-specific versions, although I haven't fully tested them, because I'm not entirely sure how they're used. (I've pressed Ctrl-C on a running instance once and it seemed to terminate the running ffmpeg instances. But then again, I think they were normal individual processes, so I don't see the need for project groups yet.)
Also, the build configuration for Linux and other non-Windows platforms is completely untested.

I believe I also got stream support working, by mashing together some of the bash scripts into a Windows Batch file and replacing that one bit where it concats .sh to the profile name with .cmd. However, I'm only doing VOD and I just found out, that I apparently don't even need those bash scripts, so it isn't included here.

Note that this is the first time I've written or built any Go, so my code is probably not very idiomatic. Suggestions (including required reading) welcome.

@m1k1o
Copy link
Owner

m1k1o commented Nov 17, 2022

Although Windows-support was never considered in this project, it seems like a valid usecase and should be included in this project. However, I would prefer to see this OS-specific code outside of the streaming logic. For example, creating a simple helper structure that handles lifecycle of a command.

This OS-specific code that handles linux's process groups was supposed to solve #2 but it actually never did (still leaving defunct processes when trying to run multiple processes). Maybe refactroing the code to allow running chain of programs piped togehter (like | in bash) and then killing them one by one would solve this issue.

Really the only platform-dependent bits of code were the process group
management. I've replaced those with Windows-specific versions, although
I haven't fully tested them, because I'm not entirely sure how they're
used.
Also, the build configuration for Linux and other non-Windows platforms
is completely untested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants